package com.fintech.third.dao;

import com.fintech.third.model.message.SmsSend;
import com.fintech.third.model.message.SmsSendFailure;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SmsMapper {
	
	
	/**
	 * 将已发送信息插入到已发送信息表
	 * @param sms
	 * @return
	 */
	public  void  insertSmsSend(SmsSend sms);
	
	
	
	/**
	 * 将发送失败的短信插入发送失败的短信表
	 * @param sms
	 * @return
	 */
	public  void  insertSmsSendFailure(SmsSendFailure SmsSendFailure);
	

	/**
	 * 根据id获取发送失败短信信息
	 * @param smsSendFailureId
	 */
	public  SmsSendFailure  obtainSmsSendFailureInfo(long smsSendFailureId);
	
	
	/**
	 * 根据id删除短信失败表中重发成功的短信
	 * @param smsSendFailureId
	 */
	public void deleteSmsSendFailureInfo(long smsSendFailureId);
	
	
	/**
	 * 更新发送失败短信信息
	 * @param smsSendFailureId
	 */
	public  void  updateSmsSendFailureInfo(long smsSendFailureId);
	
	
	
	/**
	 * 插入定时发送短信信息
	 * @param smsSendFailureId
	 */
	public  void  insertTimingSms(List<SmsSend> list);
	
	
	
	/**
	 * 查询未发送的短信列表
	 * @param smsSendFailureId
	 */
	public  List<SmsSend>  selectSmsSendList();
	
	
	/**
	 * 查询未发送的短信列表(自定义短信)
	 * @param smsSendFailureId
	 */
	public  List<SmsSend>  selectSmsDefineList();
	
	
	/**
	 * 批量修改发送状态
	 * @return
	 */
	public  void  updateSmsSendDetail(SmsSend send);
	
	
	/**
	 * 批量删除短信发送表中的短信
	 * @return
	 */
	public  void  deleteSmsSendDetail(SmsSend send);
	
	/**
	 * 将发送失败的短信批量插入发送失败的短信表
	 * @param sms
	 * @return
	 */
	public  void  insertSmsSendFailureList(List<SmsSend> send);
	
	
	
	/**
	 * 根据第三方返回的msgId修改tm_sms_send的回执状态
	 * @param sms
	 * @return
	 */
	public  int  updateSmsSendByMsgId(@Param("receiptStatus") String receiptStatus,@Param("msgId") String msgId);
	
	
	/**
	 * 根据第三方返回的msgId修改tm_sms_send_failure的回执状态
	 * @param sms
	 * @return
	 */
	public  int  updateSmsSendFailureByMsgId(@Param("receiptStatus") String receiptStatus,@Param("msgId") String msgId);
	
	
	public Integer querySendSuccussCount(@Param("phone") String phone, @Param("templateId") String templateId);
	
}
